﻿//---------------------------------------------------------------------
// Author: Reinhard Lehrbaum
//
// Description: Wrapper for the DirectoryEntry.
//
// Creation Date: 2007-01-23
//---------------------------------------------------------------------

using System;
using System.DirectoryServices;

namespace Pscx.Providers
{
    public class ActiveDirectoryEntry
    {
        private DirectoryEntry _entry;
        private string _type;

        public string Name
        {
            get { return _entry.Properties["name"].Value.ToString(); }
        }

        public string Type
        {
            get { return _type; }
        }

        public string Description
        {
            get
            {
                try
                {
                    return _entry.Properties["description"].Value.ToString();
                }
                catch
                {
                    return "";
                }
            }
        }

        public DirectoryEntry NativeObject
        {
            get { return _entry; }
        }

        public ActiveDirectoryEntry(DirectoryEntry entry, string type)
        {
            _entry = entry;
            _type = type;
        }
    }
}
